package com.g2room.myuall.grap.ky;

import java.io.IOException;
import java.net.MalformedURLException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.alibaba.fastjson.JSON;
import com.g2room.driving.grap.GenericGrap;
import com.g2room.myuall.grap.ky.model.po.DicType;
import com.g2room.myuall.grap.ky.model.po.GrapErr;
import com.g2room.myuall.grap.ky.model.po.PeeArti;
import com.g2room.myuall.util.DateUtil;
import com.g2room.myuall.util.DbUtil;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;

/**
 * 根据考研大学抓取相关信息
 * @author butterfly
 *
 */
public class CopyOfGrapKyArti implements Runnable {
	public static void main(String[] args) throws Exception{
		for(int i=0; i<1000;  i++) {
			CopyOfGrapKyArti gka = new CopyOfGrapKyArti();
			Thread t = new Thread(gka);
			t.start();
		}
	}
	
	private void getPage() {
		Document doc = null;
		try {
			doc = GenericGrap.getDocByIp("http://m.hme.cn/shop/search-shop-list.jhtm?pageNum=1&areaCode=&typeIds=&type=3&keyWord=&busTypeId=1&assignVersion=2&numPerPage=999&location=&t"+System.nanoTime());
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		if(doc == null) return ;
		System.out.println(doc.html().substring(0,  100));
	}
	@Override
	public void run() {
		// TODO Auto-generated method stub
		getPage();
	}
}
